home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 24 / CU Amiga Magazine's Super CD-ROM 24 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-07].iso / CUCD / Utilities / vim-5.1 / vimrc_example < prev    next >
Encoding:
Text File  |  1998-03-26  |  1.8 KB  |  54 lines

  1. " Vim
  2. " An example for a vimrc file.
  3. "
  4. " To use it, copy it to
  5. "     for Unix and OS/2:  ~/.vimrc
  6. "             for Amiga:  s:.vimrc
  7. "  for MS-DOS and Win32:  $VIM\_vimrc
  8.  
  9. set nocompatible    " Use Vim defaults (much better!)
  10. set bs=2        " allow backspacing over everything in insert mode
  11. set ai            " always set autoindenting on
  12. set tw=78        " always limit the width of text to 78
  13. set backup        " keep a backup file
  14. set viminfo='20,\"50    " read/write a .viminfo file, don't store more
  15.             " than 50 lines of registers
  16.  
  17. " Don't use Ex mode, use Q for formatting
  18. map Q gq
  19.  
  20. augroup cprog
  21.   " Remove all cprog autocommands
  22.   au!
  23.  
  24.   " When starting to edit a file:
  25.   "   For *.c and *.h files set formatting of comments and set C-indenting on.
  26.   "   For other files switch it off.
  27.   "   Don't change the order, it's important that the line with * comes first.
  28.   autocmd BufRead *       set formatoptions=tcql nocindent comments&
  29.   autocmd BufRead *.c,*.h set formatoptions=croql cindent comments=sr:/*,mb:*,el:*/,://
  30. augroup END
  31.  
  32. augroup gzip
  33.   " Remove all gzip autocommands
  34.   au!
  35.  
  36.   " Enable editing of gzipped files
  37.   "      read:    set binary mode before reading the file
  38.   "        uncompress text in buffer after reading
  39.   "     write:    compress file after writing
  40.   "    append:    uncompress file, append, compress file
  41.   autocmd BufReadPre,FileReadPre    *.gz set bin
  42.   autocmd BufReadPost,FileReadPost    *.gz '[,']!gunzip
  43.   autocmd BufReadPost,FileReadPost    *.gz set nobin
  44.   autocmd BufReadPost,FileReadPost    *.gz execute ":doautocmd BufReadPost " . expand("%:r")
  45.  
  46.   autocmd BufWritePost,FileWritePost    *.gz !mv <afile> <afile>:r
  47.   autocmd BufWritePost,FileWritePost    *.gz !gzip <afile>:r
  48.  
  49.   autocmd FileAppendPre            *.gz !gunzip <afile>
  50.   autocmd FileAppendPre            *.gz !mv <afile>:r <afile>
  51.   autocmd FileAppendPost        *.gz !mv <afile> <afile>:r
  52.   autocmd FileAppendPost        *.gz !gzip <afile>:r
  53. augroup END
  54.